<?php 

class Silk_Tms_Helper_Data extends Mage_Core_Helper_Abstract
{
	public function getRegion($websiteId){
		$collection = Mage::getModel("tms/region")->getCollection();
		if($websiteId){
			$collection->addFieldToFilter("website_id",$websiteId);
		}
		$data = array();
		foreach ($collection as $key => $value) {
			$data[$value->getId()]=$value->getName();
		}
		return $data;
	}
	public function getCar($websiteId){
		$collection = Mage::getModel("tms/car")->getCollection();
		if($websiteId){
			$collection->addFieldToFilter("website_id",$websiteId);
		}
		$data = array();
		foreach ($collection as $key => $value) {
			$data[$value->getId()]=$value->getNumber();
		}
		return $data;
	}
}